<?php

namespace App\Exceptions;

use Exception;

class ApiException extends Exception
{

    public function __construct(string $message, int $code = 500)
    {
        parent::__construct($message, $code);

    }

    public function render()
    {
        $result = [
            "message" => $this->message,
            "code" => $this->code,
            "status" => false,
        ];

        return response()->json($result);
    }
}
